<!DOCTYPE html>
<html>

	<head>
		<title>深圳市消消乐有害生物防治有限公司-产品与服务</title>
		<meta charset="UTF-8" />
		<script type="text/javascript" src="js/swiper.min.js"></script>
		<link rel="stylesheet" href="css/swiper.min.css" />
		<link rel="stylesheet" href="css/bootstrap.min.css" />
		<link rel="stylesheet" href="css/style.css" />
		<script type="text/javascript" src="js/jquery-3.4.1.min.js"></script>
		<script src="js/xs.js"></script>
		<script type="text/javascript" src="js/global.js"></script>
		<script type="text/javascript" src="js/pages.js"></script>
	</head>

	<body>

		<div class="container bg-white">
			<div id="head"></div>
			<div class="banner row">
				<div>
					<img src="img/pro_banner.jpg" width="100%" />
				</div>
			</div>

			<div class="row" style="margin-top: 20px;">
				<div class="col-sm-3 col-xs-12 p-0">
					<div class="card">
						<div class="cardHead">
							<div class="float-left">
								<img class="float-left" src="img/zxq3.jpg" / style="margin-top: 7px;margin-right: 3px;">
								<div class="titleIco float-left">产品与服务</div>
							</div>
						</div>
						<div class="cardBody">
							<ul id="navList" class="list-group list-group-flush"></ul>
						</div>
					</div>
					<div class="card" style="margin-top: 15px;">
						<div class="cardHead">
							<div class="float-left">
								<img class="float-left" src="img/zxq3.jpg" / style="margin-top: 7px;margin-right: 3px;">
								<div class="titleIco float-left">联系我们</div>
							</div>
						</div>
					<div id="contact2" class="cardBody p-3 c666" style="background: url(img/20130530101646794679.jpg) right bottom no-repeat;min-height: 200px;line-height: 25px;">
					</div>
					</div>
				</div>
				<div class="col-sm-9 col-xs-12 p-0">
					<div class="card" style="margin-left: 20px;">
						<div class="cardHead">
							<div class="float-left">
								<img class="float-left" src="img/zxq3.jpg" / style="margin-top: 7px;margin-right: 3px;">
								<div class="titleIco float-left">产品详情</div>
							</div>
						</div>
						<div class="cardBody container-fluid">
							<div id="title"></div>
							<div id="picList">
								<!-- Swiper -->
								<div class="swiper-container">
									<div class="swiper-wrapper" id="list1">
									</div>
									<!-- Add Arrows -->
									<div class="swiper-button-next swiper-button-white"></div>
									<div class="swiper-button-prev swiper-button-white"></div>
								</div>
							</div>
							<div id="content"></div>
						</div>
					</div>
				</div>
				<div id="foot"></div>
			</div>

			<div class="scrollsidebar" id="scrollsidebar"></div>

		</div>
		<script>
			var pId = getUrlParam("pId")
			var nId = getUrlParam("nId")
			var aId = getUrlParam("aId")

			$.ajax({
				type: "POST",
				async: false,
				url: baseURL + "lable/queryWebLableList.do",
				data: {
					pId: pId
				},
				dataType: "json",
				success: function(res) {

					//三级分类
					res.data.forEach((item, index) => {
						$("#navList").append(`<li class="list-group-item"><div class="nav2List"><img src="./img/maximize.png"><span>${item.lableName}</span></div></li>`)

						$("#navList>li").eq(index).append(`<ul class="list-group nav3List list-group-flush p-l-20"></ul>`)
						getNavList(item, index)

					})

				}
			});

			//			获取三级栏目
			function getNavList(item, index) {
				$.ajax({
					type: "POST",
					async: false,
					url: baseURL + "lable/queryWebLableList.do",
					data: {
						pId: item.id
					},
					dataType: "json",
					success: function(ress) {
						console.log({
							三级分类: ress
						})

						if(ress.data.length > 0) {
							ress.data.forEach((items, indexs) => {
								$("#navList>li").eq(index).find("ul").append(`<li class="list-group-item"><a href="./projectList.html?pId=${pId}&nId=${items.id}">${items.lableName}</a></li>`)
							})
						} else {
							$("#navList>li").eq(index).find("ul").append(`<li class="list-group-item"><a href="./projectList.html?pId=${pId}&nId=${item.id}">${item.lableName}</a></li>`)
						}

					}
				});

			}

			$.ajax({
				type: "POST",
				async: false,
				url: baseURL + "article/queryArticleById.do",
				data: {
					id: aId
				},
				dataType: "json",
				success: function(ress) {
					if(ress.data) {

						if(JSON.parse(ress.data.imageUrl).length > 1) {

							JSON.parse(ress.data.imageUrl).forEach(function(item) {
								$("#list1").append(`<div class="swiper-slide"><img src="${item}" width="100%"></div>`)
								var swiper = new Swiper('.swiper-container', {
									autoHeight: true,
									spaceBetween: 20,
									pagination: {
										el: '.swiper-pagination',
										clickable: true,
									},
									navigation: {
										nextEl: '.swiper-button-next',
										prevEl: '.swiper-button-prev',
									},
								});

							})
						}
						$("#title").html(ress.data.title)
						$("#content").html(ress.data.details)
					}
				}
			});

			$(".nav2List").click(function() {
				$(this).next().fadeToggle()
			})
		</script>
	</body>

</html>